import request from "@/utils/request";
import type { SearchEmpModel, ResultModel, StuModel } from "@/api/model/model";

export const queryStuList = (
  name: string,
  degree: string,
  clazzId: string,
  page: number,
  pageSize: number
) =>
  request.get<any, ResultModel>(
    `/students?name=${name}&degree=${degree}&clazzId=${clazzId}&page=${page}&pageSize=${pageSize}`
  );
export const addStu = (stu: StuModel) =>
  request.post<any, ResultModel>("/students", stu);
export const getStuById = (id: number) =>
  request.get<any, ResultModel>(`/students/${id}`);
export const updateStu = (stu: StuModel) =>
  request.put<any, ResultModel>("/students", stu);
export const deleteStuByIds = (ids: string) =>
  request.delete<any, ResultModel>(`/students/${ids}`);

export const putViolation = (id: string, score: string) =>
  request.put<any, ResultModel>(`/students/violation/${id}/${score}`);
